package com.mentaleye.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mentaleye.dal.dao.StudentActivityDao;
import com.mentaleye.dal.model.StudentActivity;
import com.mentaleye.dal.service.StudentActivityMapper;
@Repository
public class StudentActivityDaoImpl implements StudentActivityDao{
	@Autowired
	private StudentActivityMapper studentActivityMapper;
	@Override
	public List<StudentActivity> selectByMap(Map<String, Object> map) {
		List<StudentActivity> list = studentActivityMapper.selectByMap(map);
		return list;
	}
	@Override
	public boolean addStuActivity(StudentActivity studentActivity) {
		int result = studentActivityMapper.insert(studentActivity);
		return result>0;
	}
	@Override
	public boolean updateStuActivity(StudentActivity studentActivity) {
		int result = studentActivityMapper.updateByPrimaryKey(studentActivity);
		return result>0;
	}
	@Override
	public StudentActivity selectById(Integer id) {
		StudentActivity studentActivity = studentActivityMapper.selectByPrimaryKey(id);
		return studentActivity;
	}
	@Override
	public boolean updateStatusById(StudentActivity studentActivity) {
		int result = studentActivityMapper.updateStatusById(studentActivity);
		return result>0;
	}

	@Override
	public boolean updateByPrimaryKeySelectiveById(StudentActivity record) {
		int result = studentActivityMapper.updateByPrimaryKeySelective(record);
		return result>0;
	}

}
